<template>
	<div>
		<div class="artcile-title">
			<p>{{article.title}}</p>
		</div>
		<P style="padding: 1rem;">
			<label style="color: #a0a0e5;font-size: 1.4rem;">{{article.author}}</label>
			<small style="color: #666;">{{article.creationTime}}</small>
			<small style="color: #666;float:right;line-height: 2;">{{article.click}}人阅读</small>
		</p>
		<div class="detail-content" style="margin-top:3rem;">
			<div class="content" v-html="article.content">
				{{article.content}}
			</div>
		</div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				article: {}
			}
		},
		components: {

		},
		beforeCreate: function() {
			//组件实例刚刚被创建，但组件属性尚未
			//alert(config.ApiUrl);
			var id = this.$route.params.id;
			this.$http.post(config.ApiUrl + 'article/detail/' + id, {}, {
				emulateJSON: true
			}).then(function(res) {
				console.log(res.body.data);
				this.article = res.body.data;
			}, function(res) {
				console.log('失败')
			});
		},
		mounted: function() {

		}
	}
</script>

<style>
	.artcile-title p {
		text-align: center;
		margin: 1rem;
		font-size: 1.8rem;
	}
</style>
